﻿<%@Page Language="C#" MasterPageFile="~/Views/Shared/_Layout.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

@{
    ViewBag.Title = "Feed";

    string feedUrl = ("~{0}/detail".FormatInvariant((string)Model.CurrentFeed.Url)).ResolveUri(ViewContext.HttpContext);
}

@section sidebar
{
    @{Html.RenderPartial("_SidebarDetailAuthors");}
    @{Html.RenderPartial("_SidebarDetailOwners");}
}

<h1>Feed - @Model.CurrentFeed.DisplayName</h1>

<div class="archive-pagination ">
	<div class="left"><a href="../../">« Back to feed</a></div>
	<div class="right">&nbsp;</div>
	<div class="clearer">&nbsp;</div>
</div>

<div class="section">
	<div class="section-title">Package</div>
	<div class="section-content">
		<div class="post">
			<div class="post-title"><h2>@Model.CurrentPackage.Id (@Model.CurrentPackage.Version)</h2></div>
			<div class="post-date">@Model.CurrentPackage.LastUpdated.ToString("HH:mm, dddd, MMM dd, yyyy")</div>
			<div class="post-body">
                <p>
                @if (@Model.CurrentPackage.IconUrl != null)
                { 
				    <img class="bordered left" alt="" src="@Model.CurrentPackage.IconUrl.ToString()" />
                }
                else
                { 
                    <img class="bordered left" alt="" src="/content/images/logo-small.png" />
                }
                @Model.CurrentPackage.Summary
                <div class="clearer">&nbsp;</div></p>
                <p>
                    @Model.CurrentPackage.Description</p>
                <p>
                @if (@Model.CurrentPackage.ProjectUrl != null)
                { 
	                <div class="left">
                        <a class="more" href="@Model.CurrentPackage.ProjectUrl" target="_blank">Learn more »</a></div>
                }
                @if (@Model.CurrentPackage.LicenseUrl != null)
                { 
	                <div class="right">
                        <a class="more" href="@Model.CurrentPackage.LicenseUrl" target="_blank">License</a></div>
                }
	                <div class="clearer">&nbsp;</div>
                </p>
			</div>
		</div>
		<div class="clearer">&nbsp;</div>
	</div>
</div>

<div class="section">
    <div class="section-title">
        Dependencies</div>
    <div class="section-content">
        <ul class="nice-list">
            @foreach (var dep in Model.CurrentPackage.Dependencies)
            {
                <li>
                    <div class="left">
                        <a href="#">@dep.Id</a></div>
                    <div class="right">
                        @dep.Version.ToString()</div>
                    <div class="clearer">
                        &nbsp;</div>
                </li>                    
            }
        </ul>
    </div>
</div>